import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import router from "./router";
import 'virtual:svg-icons-register'
import '@/styles/reset.scss'
import pinia from "./store";
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/theme-chalk/dark/css-vars.css'
import './permission'
import roleButton from "@/directive/roleButton.ts";

const app = createApp(App)

app.use(ElementPlus,{
    locale:zhCn
})
app.use(router)
app.use(pinia)
app.directive('roleButton',roleButton)

// 创建全局组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.mount('#app')
